Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

57
Visualizações
TypeError: (0, _$$_REQUIRE(_dependencyMap[0], "redux").createStore) is not a function react-native

I'm new in redux I'm trying to connect redux with react native when I set all and In App.js i add <provider store={store}> it display me that error: TypeError: (0, _$$_REQUIRE(_dependencyMap[0], "redux").createStore) is not a function.

App.js

import { Counter } from './assets/counter';
import { Provider } from 'react-redux';
import {store} from './assets/store/store'
const App= (props) => {
  return (
    <View style={{flex:1}}>
      <Provider store={store} >
        <Counter/>
      </Provider>
    </View>
  );
};


export default App;

cunter.js

export const Counter = (props) =>{
    return(
        <View style={{flex:1,justifyContent:'center', alignItems:'center'}} >
            <Button title="Add Inc"  />
            <Text>Counter</Text>
            <Button title="Add Dec"  />
        </View>
    )
}

store.js

import {createStore} from 'redux'
import {mainReducer} from './reducers'


export const store = createStore(mainReducer)

reducer.js

import {ADDITION, SUBTRACTION} from './actionType'

const initialState = {
    counter:0
}

export const mainReducer=(state=initialState, action)=>{
    switch (action.type) {
        case ADDITION:
            return {...state, counter:state.counter+1}
        case SUBTRACTION:
            return {...state, counter:state.counter-1}
    
        default:
            return state
    }
}

package.json

  "dependencies": {
    "react": "17.0.1",
    "react-native": "0.64.2",
    "react-redux": "^7.2.4",
    "redux": "^4.1.1"
  },
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

i have same problem but its solved and i just want to share.. its all happen because "npx react-native init Redux" well i try to create another react-native init with different name and move all folder from old one that i named it "Redux" then its all running normal.. so do not try to create folder or event project name with same modul thats we installed via NPM.. hope its help and enjoy your day.. thank you..

about 4 years ago · Juan Pablo Isaza Relatório

0

For anyone running into a similar issue - I fixed this by removing a dependancy cycle in my import statements.

E.g. A imports from B imports from A.

I had to move the function I was importing from A into file B (so B did not import from A).

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda